#ifndef  __CLIENT_H__
#define  __CLIENT_H__

#include <my_header.h>

typedef enum{
     CDCOMMAND,
     LSCOMMAND,
     PWDCOMMAND,
     MKDIRCOMMAND,
     RMDIRCOMMAND,
     PUTSCOMMAND,
     GETSCOMMAND,
     REMOVECOMMAND,
     EXITCOMMAND,
     REGITSTER,
     LOGIN
}CommandSet;
// 命令传输格式
typedef struct commandPacket_s{
      CommandSet cmd;
      int length;
      char argument[1000];
}commandPacket_t;

// 收回来的消息
typedef struct train_s{ 
      int  length;
      char data[1000];
}train_t;

// 合法返回1，非法返回0
int isValidCommand(const char *cmd);

int getCommandType(const char *cmd,commandPacket_t* pcommandPacket);

int recvn(int sockfd,void *buf,int length);

int setCommandPacket(commandPacket_t* pcommandPacket,const char *cmd,const char *arg);

                                                           
int getsFunc(int sockfd, char *filename);
int putsFunc(int sockfd, char *filename);

int doRegister(int sockfd);

int doLogin(int sockfd);

void showMenu();
#endif
